import request from '@/utils/request';

export async function getInspectionTemplateMasterItemByPage (params: any) {
    return request('/api/quality/getInspectionTemplateMasterItemByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addInspectionTemplateMasterItem (params: any) {
    return request('/api/quality/addInspectionTemplateMasterItem', {
    method: 'POST',
    data: params,
  });
}

export async function updateInspectionTemplateMasterItem (params: any) {
    return request('/api/quality/updateInspectionTemplateMasterItem', {
    method: 'POST',
    data: params,
  });
}

export async function delInspectionTemplateMasterItem (params: any) {
    return request('/api/quality/delInspectionTemplateMasterItem', {
    method: 'POST',
    data: params,
  });
}

export async function exportInspectionTemplateMasterItem(params: any) {
    return request('/api/quality/exportInspectionTemplateMasterItem', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

// 新建排序去重
export async function getInspectionTemplateMasterItemBySortId (para: any) {
  return request('/api/quality/getInspectionTemplateMasterItemBySortId', {
  method: 'POST',
  data: para,
  params: {
    inspectionTemplateId: para.inspectionTemplateId,
    sortId: para.sortId,
  },
});
}

export default { getInspectionTemplateMasterItemByPage, addInspectionTemplateMasterItem, updateInspectionTemplateMasterItem, delInspectionTemplateMasterItem, exportInspectionTemplateMasterItem }
